package com.cwhuang.g7_tool_myhymns;


public class Hymn implements Comparable<Hymn>{
	private int serial;									
	private int index;									
	private String title;								
	private int rating;									
	private int familiarity;							
	private String style;								
	private String group;								
	private String memo;								
	private int times;									
	
	public Hymn(){
		serial = -1;
		index = 0;
		title = "";
		rating = 0;
		familiarity = 0;
		group = "";
		style = "";
		memo = "";
		times = 0;
	}
	
	public Hymn(int serial, int index, String title, int rating, int familiarity,
				String style, String group,  String memo){
		this.serial = serial;
		this.index = index;
		this.title = title;
		this.rating = rating;
		this.familiarity = familiarity;
		this.style = style;
		this.group = group;
		this.memo = memo;
	}
	
	public int compareTo(Hymn h){
		return index - h.getIndex();
	
	}
	
	public void setSerial(int serial){	this.serial= serial;	}
	public int getSerial(){	return serial;	}
	
	public void setIndex(int index){	this.index = index;	}
	public int getIndex(){	return index;	}
	
	public void setTitle(String title){	this.title = title;	}
	public String getTitle(){	return title;	}
	
	public void setRating(int rating){	this.rating= rating;	}
	public int getRating(){	return rating;	}

	public void setGroup(String group){	this.group += group;	}
	public String getGroup(){ return group;	}
	
	public void setStyle(String style){	this.style += style;	}
	public String getStyle(){ return style;	}	
	
	public void setFamiliarity(int familiarity){ this.familiarity = familiarity;	}
	public int getFamiliarity(){ return familiarity;	}
	
	public void setMemo(String memo){	this.memo += memo;	}
	public String getMemo(){ return memo;	}
	
	public void setTimes(int times){	this.times = times;	}
	public int getTimes(){ return times;	}
	
	public String toSring(){	return title;	}
	
	public void show(){
		System.out.printf("��%3d�� �P��%d %s %2d�����x��%3d%% %s/ %s/ %s\n",index, rating, title, times, familiarity, style,group,memo);
	}
	
	public Hymn clone(){
		Hymn nextHymn = new Hymn();
		nextHymn.setSerial(serial);
		nextHymn.setIndex(index);
		nextHymn.setTitle(title);
		nextHymn.setRating(rating);
		nextHymn.setFamiliarity(familiarity);
		nextHymn.setStyle(style);
		nextHymn.setGroup(group);
		nextHymn.setMemo(memo);
		nextHymn.setTimes(times);
		return nextHymn;
	}
}